{__NOLAYOUT__}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>{$Think.config.WEBSITE_NAME} | 登录</title>
	{css href="/bootstrap3/css/bootstrap.css" /}
	<!-- {css href="/bootstrap3/css/bootstrap.min.css" /} -->
	{css href="/font-awesome-4.6/css/font-awesome.min.css" /}
	{css href="/css/admin/login.css" /}
	{js href="/plugins/jquery-3.1.0.min.js" /}
	{js href="/bootstrap3/js/bootstrap.js" /}
</head>
<body>
<div id="login-wrapper">
    <div class="login-main">
        <div class="login-logo"></div>
        <div class="login-form">
            <div class="login-form-header">
                <p class="">登 录</p>
            </div>
            <div class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-3 control-label">账 号</label>
                    <div class="col-sm-8">
                        <input type="mobile" class="form-control" id="mobile" placeholder="Mobile" value="13330613321">
                        <span class="glyphicon glyphicon-user form-control-feedback" style="right: 14px;"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">密 码</label>
                    <div class="col-sm-8">
                        <input type="password" class="form-control" id="password" placeholder="Password" value="123">
                        <span class="glyphicon glyphicon-lock form-control-feedback" style="right: 14px;"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-8">
                        <div class="msgerr"></div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-9">
                        <button type="submit" class="btn btn-primary btn-lg btn-block" data-loading-text="登录中···" data-complete-text="登录成功">登 录</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(document).ready(function () {
		if($("#mobile") == ''){
			$("#mobile").focus();
		}else if($("#password") == ''){
			$("#password").focus();
		}
		var data = {};
		var msgerr = $(".msgerr")
		var $btn = $("button")
		$('button').click(function () {
			data.mobile = $("#mobile").val()
			data.password = $("#password").val()
			if(data.mobile == ''){
				msgerr.addClass('msg-info').html("请输入账号！")
			}else if(data.password == ''){
				msgerr.addClass('msg-info').html("请输入密码！")
				return false;
			}else{
				$.ajax({
					url: '/admin/login/doLogin/',
					type: 'post',
					data: data,
					dataType: 'json',
					success:function (data) {
						if(data.code == 1){
							$btn.button('loading')
							setTimeout(function() {
								$btn.button('complete')
				                window.location.href = data.url;
				            }, parseInt(data.wait) * 500)
						}else if(data.code == 0){
							msgerr.addClass('msg-info').html(data.msg);
						}
					},
					error:function () {
						msgerr.addClass('msg-error').html("网络错误，请稍后再试！");
					}
				})
			}
		})
	})
</script>
</body>
</html>

	
